package com.xl.sst.controller;



import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xl.sst.biz.SiteSearchBiz;
import com.xl.sst.vo.Desired;
import com.xl.sst.vo.Goods;
import com.xl.sst.vo.Users;



/*
 * 站内搜索处理层
 * yue
 */
@Controller
@RequestMapping("/view")
public class SiteSearchController {
	@Resource
	public SiteSearchBiz siteSearchBiz;
	public SiteSearchBiz getSiteSearchBiz() {
		return siteSearchBiz;
	}
	public void setSiteSearchBiz(SiteSearchBiz siteSearchBiz) {
		this.siteSearchBiz = siteSearchBiz;
	}
	/*
	 * 搜索服务
	 * 搜索服务类别或者具体服务
	 */
	@RequestMapping("/searchService.do")
	public @ResponseBody Map<String,Object> searchService(Desired d){
		Map<String,Object> m =new HashMap<String, Object>();
		m.put("service", siteSearchBiz.searchService(d));
		return m;	
		
	}
	/*
	 * 搜索企业
	 *
	 */
	@RequestMapping("/searchFirm.do")
	public @ResponseBody Map<String,Object> searchFirm(Users s){
			Map<String,Object> m =new HashMap<String, Object>();
			m.put("firm", siteSearchBiz.searchFirm(s));
			return m;	
	}
	/*
	 * 搜索公司货
	 */
	@RequestMapping("/searchCargo.do")
	public @ResponseBody  Map<String,Object> searchCargo(Goods g){
		Map<String,Object> m =new HashMap<String, Object>();
		m.put("cargo", siteSearchBiz.searchCargo(g));
		return m;
		
	}
}
